#ifndef THUMBNAILPROCESS_H
#define THUMBNAILPROCESS_H

#include "image_process.h"

class ThumbnailProcess : public ImageProcess
{
    Q_OBJECT
public:
    ThumbnailProcess();
    ~ThumbnailProcess() override;

    int setROI(unsigned short x, unsigned short y, unsigned short width, unsigned short height) override;
    int getROI(unsigned short &x, unsigned short &y, unsigned short &width, unsigned short &height) const override;

    int generateUploadImage(const unsigned char *image_pointer) override;
    int getUploadImagedata(QByteArray &upload_image) override;

private:
    int generateThumbnail(const unsigned char *const image_pointer);
    int generateSlice(const unsigned char *const image_pointer);

private:
    //图像开窗数据
    unsigned short image_x_ = 0;
    unsigned short image_y_ = 0;
    unsigned short image_width_ = 8424;
    unsigned short image_height_ = 6032;

    unsigned short limit_slice_width_ = 800;
    unsigned short limit_slice_height = 600;

    unsigned short image_all_line_ = 600;
    unsigned short image_start_line_ = 0;
    unsigned short image_end_line_ = 600;
    unsigned short image_per_line_bytes_ = 800;
    QByteArray image_prefix_message_;

    QByteArray upload_bytearray_;

    //每次启动图像计数编号
    unsigned int image_count_number_ = 0;
};

#endif // THUMBNAILPROCESS_H
